package com.accenture.adf.newcodington.module9.sample;

/**
 * 
 * Movie3D is about a theater in the New Codington
 * 
 * Topic: Demo on usage of parameterized constructor
 * 
 * Instructions:
 * 1. Use 'Movie3D_Demo2' as the starting point and make the following changes
 * 2. Change the class name to 'Movie3D_Demo3'
 * 		a. Change all references of 'Movie3D_Demo2' to 'Movie3D_Demo3' (for example constructors)
 *      (Hint: use the Search and Replace feature in Eclipse)
 * 3. Declare a private integer variable for screen ID between class declaration and main() method
 * 4. On next line, declare a private integer variable for screen size 
 * 5. On next line, declare a private double variable for temperature within the theater
 * 6. On next line, declare a private integer variable for number of seats in the theater
 * 7. On next line, declare a private string variable for movie name       
 * 8. Create a parameterized constructor taking screen size, temperature, number of seats 
 *    and movie name as parameters after default constructor
 * 9. Assign parameter values to the respective instance variables inside the parameterized constructor
 * 10. Print "Parameterized constructor invoked" to console from parameterized constructor
 * 11. Modify main() method to create two instances of 'Movie3D_Demo3' using the parameterized 
 *    constructor with appropriate arguments based on data type
 * 12. Print all the values of the instance variables using the newly created 'Movie3D_Demo3' instance
 * 
 */


public class Movie3D_Demo3 {
	
	//Static fields
	private static String theaterType;
	private static String theaterName;
	
	//Instance variables
	private int screenId;
	private int screenSize;
	private double temperature;
	private int noOfSeats;
	private String movieName;

	static{
		theaterType = "3D";
		theaterName = "Cinema One";
		System.out.println("Static block initialiazed.");
	}
	
	public static void main(String[] args){
		System.out.println("theater Type : " + theaterType);
		System.out.println("theater Name : " + theaterName);
		
		//movie3d - is a local variable 
		Movie3D_Demo3 movie1  = new Movie3D_Demo3(1, 35, 28, 50, "Avatar 3D");
		
		System.out.println();
		System.out.println("Screen ID: "+ movie1.screenId);
		System.out.println("Screen size: "+ movie1.screenSize);
		System.out.println("theater temperature: "+ movie1.temperature);
		System.out.println("theater seating capacity: "+ movie1.noOfSeats);
		System.out.println("Movie name: "+ movie1.movieName);
		
		Movie3D_Demo3 movie2  = new Movie3D_Demo3(2, 50, 25, 100, "Hugo 3D");
		
		System.out.println();
		System.out.println("Screen ID: "+ movie2.screenId);
		System.out.println("Screen size: "+ movie2.screenSize);
		System.out.println("theater temperature: "+ movie2.temperature);
		System.out.println("theater seating capacity: "+ movie2.noOfSeats);
		System.out.println("Movie name: "+ movie2.movieName);
	}
	
	//Generic Constructor
	public Movie3D_Demo3() {		
		System.out.println("Default constructor invoked.");
	}

	//Parameterized constructor
	public Movie3D_Demo3(int screenId, int screenSize, double temparature, int noOfSeats,String movieName) {		
		this.screenId = screenId;
		this.screenSize = screenSize;
		this.temperature = temparature;
		this.noOfSeats = noOfSeats;
		this.movieName = movieName;
		
		System.out.println("\nParameterized constructor invoked.");
	}	

}
